/*
 * Message.hpp
 *
 *  Created on: 24 mei 2013
 *      Author: maarten
 */

#ifndef MESSAGE_HPP_
#define MESSAGE_HPP_

#include "CommandCodes.hpp"
#include <string>
#include <vector>

class Message {
public:
	Message();
	Message(char aBuffer[], int length);
	virtual ~Message();

	//handle incoming message
	int getHeader();
	char * getBody();
	int getBodyLength();
	std::vector<std::string> parseBody();

	//make outgoing message
	void setHeader(int aHeaderNr);
	void addBody(std::string aBodyPart);
	void addBody(char aBodyPart[], int length);

	//to send message
	char * getCompleteMessage();
	int getCompleteMessageSize();

private:
	char buffer[BUFFERSIZE];
	int bufferLength;
};

#endif /* MESSAGE_HPP_ */
